package com.woniuxy.threeprojcet.end_water_project_admin.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    //执行是否成功
    private Boolean status;
    //响应回前端的状态码
    private String code;
    //相关响应信息
    private String message;
    //任意类型的对象
    private Object object;
    public static Result fail(String code,String message){

        return new Result(false,code,message,null);
    }
    public static Result fail(String code,String message,Object object){
        return new Result(false,code,message,object);
    }
    public static Result success(String code,String message){
        return new Result(true,code,message,null);
    }
    public static Result success(String code,String message,Object object){
        return new Result(true,code,message,object);
    }
    public static Result success(Object object){

        return new Result(true,null,null,object);
    }
    public static Result success(){

        return new Result(true,null,null,null);
    }

}
